import memberApi from "@/api/declaration/mall/memberApi"
import httpRequest from "@/config/axios/httpRequest"
import { MemberLevelModel } from "@/models/mall/MemberLevelModel"

// 查询会员等级列表
export const getLevelList = async (params) => {
  return await httpRequest.get(memberApi.GetLevelList, { params })
}

// 查询会员等级详情
export const getLevel = async (id: number) => {
  return await httpRequest.get(memberApi.GetLevel,{params:{id}})
}

// 查询会员等级 - 精简信息列表
export const getSimpleLevelList = async () => {
  return await httpRequest.get(memberApi.GetSimpleLevelList)
}

// 新增会员等级
export const createLevel = async (data: MemberLevelModel) => {
  return await httpRequest.post(memberApi.CreateLevel,data)
}

// 修改会员等级
export const updateLevel = async (data: MemberLevelModel) => {
  return await httpRequest.put(memberApi.UpdateLevel,data)
}

// 删除会员等级
export const deleteLevel = async (id: number) => {
  return await httpRequest.delete(memberApi.DeleteLevel,{params:{id}})
}
